package com.itgone.view.adapter;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.itgone.view.fragment.TabFragment;

import java.util.List;

public class TabViewPagerAdapter extends FragmentPagerAdapter {

    private List<TabFragment> fragmentList;


    public TabViewPagerAdapter(FragmentManager fm, List<TabFragment> fragmentList) {
        super(fm);
        this.fragmentList = fragmentList;
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return fragmentList.get(position).getTitle();
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }
}
